﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DFGK_WMS.Model.DTO
{
    public class GroupReceivingOrderDto
    {
        /// <summary>
        /// 入库单编号
        /// </summary>
        public string OrderSn { get; set; }

        /// <summary>
        /// 关联单号
        /// </summary>
        public string RelevanceOrderSn { get; set; }

        /// <summary>
        /// 入库类型
        /// </summary>
        public int? BillType { get; set; }

        /// <summary>
        /// 经办人
        /// </summary>
        public string Agent { get; set; }

        public int? SupplierId { get; set; }

        /// <summary>
        /// 供应单位编号
        /// </summary>
        public string SupplierCode { get; set; }

        /// <summary>
        /// 供应单位名称
        /// </summary>
        public string SupplierName { get; set; }

        /// <summary>
        /// 供应单位联系人
        /// </summary>
        public string Contact { get; set; }

        /// <summary>
        /// 供应单位联系方式
        /// </summary>
        public string ContactMobile { get; set; }

        /// <summary>
        /// 制单时间
        /// </summary>
        public DateTime? ProductDate { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 当前登陆人Id
        /// </summary>
        public int? NowUserId { get; set; }

        /// <summary>
        /// 当前登陆人姓名
        /// </summary>
        public string NowUserName { get; set; }

        /// <summary>
        /// 角色身份
        /// </summary>
        public string NowRoule { get; set; }

        /// <summary>
        /// 级别状态
        /// </summary>
        public bool ExamineState { get; set; }=false;

        /// <summary>
        /// 订单状态
        /// </summary>
        public int State { get; set; } = 0;

        /// <summary>
        /// 凭证路径
        /// </summary>
        public List<FileClass> File { get; set; }

        public int? CreateUserId { get; set; }

        public string CreateUserName { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateDate { get; set; }

        public List<ChildrenReceivingOrder> childrenReceivingOrders { get; set; }=new List<ChildrenReceivingOrder>();
    }

    public class FileClass
    {
        public int Id { get; set; }
        public string name { get; set; }

        public string url { get; set; }
    }


    public class ChildrenReceivingOrder
    {
        public int Id { get; set; } 
        /// <summary>
        /// 装备Id
        /// </summary>
        public int? MakerialCategoryId { get; set; }

        /// <summary>
        /// 装备名称
        /// </summary>
        public string MaterialCategoryName { get; set; }

        /// <summary>
        /// 装备编码
        /// </summary>
        public string MaterialCategoryCode { get; set; }

        public string MaterialGroupId { get; set; }

        public string MaterialGroupCode { get; set; }

        /// <summary>
        /// 器材Id
        /// </summary>
        public int? MaterialId { get; set; }

        /// <summary>
        /// 器材名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 器材编码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 型号规格
        /// </summary>
        public string ModelSpec { get; set; }

        /// <summary>
        /// 质量等级
        /// </summary>
        public int QualityState { get; set; }

        public decimal? Price { get; set; }

        public decimal? ReceivePrice { get; set; }

        public int? UnitId { get; set; }

        /// <summary>
        /// 单位名称
        /// </summary>
        public string UnitName { get; set; }

        /// <summary>
        /// 入库数量
        /// </summary>
        public decimal? ReceivedQty { get; set; }

        /// <summary>
        /// 期待数量
        /// </summary>
        public decimal? Qty { get; set; }

        /// <summary>
        /// 总金额
        /// </summary>
        public decimal? TotalPrice { get; set; }

        /// <summary>
        /// 实际总金额
        /// </summary>
        public decimal? ReceivedTotalPrice { get; set; }

        /// <summary>
        /// 专业
        /// </summary>
        public string TypeName { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }


        /// <summary>
        /// 器材名称状态
        /// 如果等于1就是选择的数据，如果为0则为手填
        /// </summary>
        [NotMapped]
        public int MaterialNameStatus { get; set; }


        /// <summary>
        /// 库存状态
        /// </summary>
        public int InventoriesTypeStatus { get; set; } = 1;

        /// <summary>
        /// 库存位置
        /// </summary>
        public string? Position { get; set; }
    }
}
